<template>
	<view>
		<swiper class="top-banner" circular indicator-dots indicator-color="#ffffff77" indicator-active-color="#ffffffcc">
			<swiper-item><image class="image" src="/static/u21.jpg"></image></swiper-item>
			<swiper-item><image class="image" src="/static/u22.jpg"></image></swiper-item>
			<swiper-item><image class="image" src="/static/u23.png"></image></swiper-item>
		</swiper>
		<view class="list">
			<button type="warn" @click="clickdark">drak</button>
			<button type="primary" @click="clicklight">light</button>
			<div>{{ state.count }}</div>
			<div>{{ $lan.t('index.hello', { msg: '----' }) }}</div>
			<div>name: = {{ name }}</div>
			<button @click="clickCombobox">combobox</button>
			<button type="primary" @click="clicklanguage">{{$lan.t('name')}}</button>
		</view>
	</view>
</template>

<script>
export default {
	computed: {
		state() {
			return this.$store.state;
		}
		// lang(){
		// 	return this.$t('message')

		// 	// return {
		// 	// 	hello:'sadads'
		// 	// }
		// }
	},
	data() {
		return {
			name: 'xxxxx'
		};
	},
	methods: {
		$onShow() {
			console.log('++home----onShow');
			this.name = 'home-》$onShow';
			this.$api.homeGetInfo().then(res => {
				if (res.success) {
					this.page = 1;
					this.home_info = res.info;
				}
			});
		},
		clickdark() {
			this.$theme.commit('dark');
		},
		clicklight() {
			this.$theme.commit('light');
		},
		clicklanguage(){
			if(this.$lan.locale=='uy'){
				this.$lan.setLanguage('cn')
			}else{
				this.$lan.setLanguage('uy')
				
			}
		},
		clickCombobox(){
			this.$combobox.show({
				// success(item){
				// 	console.log(item)
				// },
				list: [
					{ value: 100, title: 'xxxx' },
					{ value: 100, title: 'xxxx' },
					{ value: 100, title: 'xxxx' },
					{ value: 100, title: 'xxxx' },
					{ value: 100, title: 'xxxx' },
					{ value: 100, title: 'xxxx' },
					{ value: 100, title: 'xxxx' },
					{ value: 100, title: 'xxxx' },
					{ value: 100, title: 'xxxx' },
					{ value: 100, title: 'xxxx' },
					{ value: 100, title: 'xxxx' },
					{ value: 100, title: 'xxxx' },
					{ value: 100, title: 'xxxx' },
					{ value: 100, title: 'xxxx' }
				]
			});
				// this.state.count = 0;
				// this.$lan.setLanguage("cn")
		
		}
		// runEvent(eventName, e) {
		// 	this[eventName]?.call(e);
		// },
		// childMethod(s){
		//  this.name = s
		// }
	}
};
</script>

<style lang="scss">
.top-banner {
	height: 400rpx;
	width: 100%;

	.image {
		width: 100%;
		height: 100%;
	}
}

.scroll {
	height: 50vh;
}

.list {
	height: 1000px;
	width: 100vw;
}

// .ddd {
// 	height: 400rpx;
// 	width: 100%;
// 	background-color: #4cd964;
// }
</style>
